<template>
  <a-layout>
    <a-layout-sider
      breakpoint="lg"
      collapsed-width="0"
    >
      <div class="logo" />
      <a-menu v-model:selectedKeys="selectedKeys" theme="dark" mode="inline">
        <a-menu-item key="1" @click="handleItemClick('/subject/list')">
          <RadarChartOutlined/>
          <span class="nav-text">课程列表</span>
        </a-menu-item>
        <a-menu-item key="2" @click="handleItemClick('/subject/add')">
          <FormOutlined />
          <span class="nav-text">新增课程</span>
        </a-menu-item>
      </a-menu>
    </a-layout-sider>
    <a-layout>
      <a-layout-content :style="{ margin: '24px 16px 0' }">
        <div :style="{ padding: '24px', background: '#fff', minHeight: '360px' }">
          <RouterView/>
        </div>
      </a-layout-content>
      <a-layout-footer style="text-align: center">
        Ant Design ©2018 Created by Ant UED
      </a-layout-footer>
    </a-layout>
  </a-layout>
</template>
<script>
import { RadarChartOutlined,FormOutlined } from '@ant-design/icons-vue';
export default {
  components: {
    RadarChartOutlined,
    FormOutlined
  },
  data(){
    return{
      selectedKeys:['1']
    }
  },
  methods:{
    handleItemClick(url){
      this.$router.push({path:url})
    }
  }
};
</script>
<style>
#components-layout-demo-responsive .logo {
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  margin: 16px;
}

.site-layout-sub-header-background {
  background: #fff;
}

.site-layout-background {
  background: #fff;
}

[data-theme='dark'] .site-layout-sub-header-background {
  background: #141414;
}
</style>